//package com.chen.back.service.impl;
//
//import com.chen.back.entity.RabbitMq;
//import com.rabbitmq.client.Channel;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.core.*;
//
//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.beans.factory.annotation.*;
//import org.springframework.stereotype.Component;
//import org.springframework.stereotype.Service;
//
//
//import java.io.IOException;
//import java.util.Map;
//
///**
// * @author chen
// * @date @{DATE} -8:04
// **/
//@RabbitListener(queues = {"TestDirectQueue"})
//@Service
//public class DirectConsumer {
//
////    @RabbitHandler
////    public void process(RabbitMq map , Channel channel, Message message) throws Exception {
////        System.out.println("消费者接受到的消息是："+map.toString());
////        //由于配置设置了手动应答，所以这里要进行一个手动应答。注意：如果设置了自动应答，这里又进行手动应答，会出现double ack，那么程序会报错。
////
////     try{
////         channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
////     }  catch (Exception e)
////     {
////         e.printStackTrace();
////     }
////    }
//}
//
